<template>
  <div class="link-body"
       v-if="list.length">
    <headline>友情链接</headline>
    <div class="link-content">
      <span v-for="(item,index) in list"
            :key="index">
        <a :href="item.website"
           target="__black">{{item.name}}</a>
      </span>
    </div>
  </div>
</template>

<script>
import Headline from '../headline';

export default {
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  components: {
    Headline
  }
}
</script>

<style lang="scss" scoped>
.link-body {
  display: flex;
  flex-direction: column;
  background: #fff;
  margin-top: 12px;
  .link-content {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 2px;
    font-size: 15px;
    :nth-child(n + 2) {
      margin-left: 5px;
    }
    span {
      cursor: pointer;
      padding: 5px 8px;
      background: #f6f6f6;
      a {
        color: #333;
        text-decoration: none;
      }
    }
  }
}
</style>